package com.example.todolist.dto;

import com.example.todolist.entity.TodoItemModel;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.NoArgsConstructor;

@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
@NoArgsConstructor
public class TodoItemResponse {
    @JsonProperty
    private long id;
    @JsonProperty
    private String content;
    @JsonProperty
    private boolean done;

    public TodoItemResponse(final TodoItemModel item) {
        this.id = item.getId();
        this.content = item.getContent();
        this.done = item.getDone();
    }
}
